<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>欢迎登陆</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
    <script type="text/javascript">
        function checkUnameAjax()
	{
	   var xmlHttpRequest;
	   //如果是火狐浏览器
	   if(window.XMLHttpRequest)
		   {
		   		xmlHttpRequest = new XMLHttpRequest();
		   }
	          //如果是IE浏览器的话
	         else if(window.ActiveXObject)
			   {
	        	   xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
			   }
			   
			   //var uname = document.loginForm.myname.value;
			   var uname = document.getElementById("uname").value;
			   var url = "servlet/LoginServlet?para=checkuser&uname="+uname+"";
				xmlHttpRequest.open("POST",url,true); // 异步调用
				xmlHttpRequest.send();	   
				   
		        xmlHttpRequest.onreadystatechange = function()
		        {
		               	    	if(xmlHttpRequest.readyState==4) //判断异步调用是否已经完成
			   
			    {         
   			          if(xmlHttpRequest.status==200){ //判断完成的提示代码是否是OK状态    
   			              
			          var text=xmlHttpRequest.responseText; //获取服务器返回的响应文本信息	               
			          document.getElementById("msg").innerHTML=text; 
			          }
			
			      else{			
			        document.getElementById("msg").innerHTML="服务器处理出现异常";
			     }     
			 }
		        
		        }

	}
        
        function load(){
        	var judge='${judge}';
        	if(judge=='pwdnull'){
        		alert('没有输入密码');
        	}else if(judge=='pwdfalse'){
        		alert('密码输入错误,请重试!');
        	}else if(judge=='usernamenull'){
        		alert('用户名输入错误!');
        	}
        	
        }
     </script> 
    <link href="css/home.css?v=2" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="js/jquery-1.7.2.js"></script>
    
  </head>
  
  <body onload=load();>
<div class="wrap">
	<div class="banner-show" id="js_ban_content">
		<div class="cell bns-01">
			<div class="con">
			</div>
		</div>
		<div class="cell bns-02" style="display:none;">
			<div class="con">
			 </div>
		</div>
		<div class="cell bns-03" style="display:none;">
			<div class="con">
			</div>
		</div>
	</div>
	<div class="banner-control" id="js_ban_button_box">
		<a href="javascript:;" class="left">左</a>
		<a href="javascript:;" class="right">右</a> </div>
	<script type="text/javascript">
                ;(function(){
                    
                    var defaultInd = 0;
                    var list = $('#js_ban_content').children();
                    var count = 0;
                    var change = function(newInd, callback){
                        if(count) return;
                        count = 2;
                        $(list[defaultInd]).fadeOut(400, function(){
                            count--;
                            if(count <= 0){
                                if(start.timer) window.clearTimeout(start.timer);
                                callback && callback();
                            }
                        });
                        $(list[newInd]).fadeIn(400, function(){
                            defaultInd = newInd;
                            count--;
                            if(count <= 0){
                                if(start.timer) window.clearTimeout(start.timer);
                                callback && callback();
                            }
                        });
                    }
                    
                    var next = function(callback){
                        var newInd = defaultInd + 1;
                        if(newInd >= list.length){
                            newInd = 0;
                        }
                        change(newInd, callback);
                    }
                    
                    var start = function(){
                        if(start.timer) window.clearTimeout(start.timer);
                        start.timer = window.setTimeout(function(){
                            next(function(){
                                start();
                            });
                        }, 8000);
                    }
                    
                    start();
                    
                    $('#js_ban_button_box').on('click', 'a', function(){
                        var btn = $(this);
                        if(btn.hasClass('right')){
                            //next
                            next(function(){
                                start();
                            });
                        }
                        else{
                            //prev
                            var newInd = defaultInd - 1;
                            if(newInd < 0){
                                newInd = list.length - 1;
                            }
                            change(newInd, function(){
                                start();
                            });
                        }
                        return false;
                    });
                    
                })();
            </script>
   <form action="${pageContext.request.contextPath}/loginController/login.do" method="post">
	<div class="container">
		<div class="register-box">
			<div class="reg-slogan" >
				<br>
				<font size="6" color="2D8ADD" face="华文行楷">航天科工资金管理系统</font></div>
			<div class="reg-form" id="js-form-mobile">
			    <br><br>
				<br>
				<div class="cell">
					<label for="uname" id="la">用户名</label>
					<input type="text" name="tUserName" id="userName" class="text" maxlength="11"onfocus="document.getElementById('la').style.display='none'; if (value !=''){document.getElementById('la').style.display='none';}"onblur="if (value ==''){document.getElementById('la').style.display='block';} checkUnameAjax();"/>
					<br><br><span id="msg" style="color: red"></span>
				</div>
				<div class="cell">
					<label for="myPwd" id="la1">密码</label>
					<input type="password" name="tUserPwd" id=" userPwd"class="text" onfocus=" document.getElementById('la1').style.display='none';if (value !=''){document.getElementById('la1').style.display='none';}"onblur="if (value ==''){document.getElementById('la1').style.display='block';}"/>
					<input type="text" name="userPwd" id="js-mobile_pwd_ipt_txt" class="text" maxlength="20" style="display:none; height=50px" />
					<br><br><span id="mmm" style="color: red"></span>
                 </div>
				<div class="bottom">
					<input type="submit" id="js-mobile_btn" class="button btn-green" value="登录" style="width:304px;" >
				</div>
			</div>
		</div>
</div>
    </form>
</div>
  </body>
</html>
